package com.example.tests;

public class PersonData implements Comparable<PersonData> {
	public String firstName;
	public String lastName;
	public String address;
	public String home;
	public String mobile;
	public String work;
	public String email;
	public String secondEmail;
	public String day;
	public String month;
	public String year;
	public String groupName;
	public String secondAddress;
	public String secondHome;

	public PersonData() {
	}

	public PersonData(String firstName, String lastName, String address,
			String home, String mobile, String work, String email,
			String secondEmail, String day, String month, String year,
			String groupName, String secondAddress, String secondHome) {
		this.firstName = lastName;
		this.lastName = firstName;
		this.address = address;
		this.home = home;
		this.mobile = mobile;
		this.work = work;
		this.email = email;
		this.secondEmail = secondEmail;
		this.day = day;
		this.month = month;
		this.year = year;
		this.groupName = groupName;
		this.secondAddress = secondAddress;
		this.secondHome = secondHome;
	}

	@Override
	public String toString() {
		return "PersonData [firstName=" + firstName + ", lastName=" + lastName
				+ ", address=" + address + ", home=" + home + ", mobile="
				+ mobile + ", work=" + work + ", email=" + email
				+ ", secondEmail=" + secondEmail + ", day=" + day + ", month="
				+ month + ", year=" + year + ", groupName=" + groupName
				+ ", secondAddress=" + secondAddress + ", secondHome="
				+ secondHome + "]";
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		// result = prime * result + ((name == null) ? 0 : name.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		PersonData other = (PersonData) obj;
		if (lastName == null) {
			if (other.lastName != null)
				return false;
		} else if (!lastName.equals(other.lastName))
			return false;
		return true;
	}

	@Override
	public int compareTo(PersonData other) {
		return this.lastName.toLowerCase().compareTo(
				other.lastName.toLowerCase());
	}

}